using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using UnityEngine.EventSystems;
using UnityEngine.UI;

public class UI_ItemSelectBase : MonoBehaviour, IPointerEnterHandler, IPointerExitHandler, IPointerClickHandler
{
    [SerializeField] protected Image _borderImage;
    protected bool _isSelect;
    public virtual void OnPointerEnter(PointerEventData eventData)
    {
        if (_isSelect)
            return;

        _borderImage.enabled = true;
    }
    public virtual void OnPointerExit(PointerEventData eventData)
    {
        if (_isSelect)
            return;

        _borderImage.enabled = false;
    }
    public virtual void OnPointerClick(PointerEventData eventData)
    {
        _isSelect = !_isSelect;
        _borderImage.enabled = _isSelect;
    }

    public bool IsSelect() => _isSelect;
}
